package com.usian;

import com.usian.pojo.TbUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "usian-sso-service")
public interface SsoFeign {


    /**
     * 用户注册信息校验
     *
     * @param checkValue
     * @param checkFlag
     * @return
     */
    @RequestMapping("/checkUserInfo/{checkValue}/{checkFlag}")
    public boolean checkUserInfo(@PathVariable String checkValue, @PathVariable int checkFlag);

    /**
     * 用户注册
     *
     * @param tbUser
     * @return
     */
    @RequestMapping("/userRegister")
    public boolean userRegister(@RequestBody TbUser tbUser);

    /**
     * 用户登录
     *
     * @param username
     * @param password
     * @return
     */
    @RequestMapping("/userLogin")
    Map userLogin(@RequestParam  String username, @RequestParam String password);

    /**
     * 校验用户的token有效时间
     *
     * @param token
     * @return
     */
    @RequestMapping("/getUserByToken/{token}")
    public int getUserByToken(@PathVariable String token );

    /**
     * 用户退出
     *
     * @param token
     * @return
     */
    @RequestMapping("/logOut")
    public int logOut(@RequestParam String token );
}
